package interview.preparation;

public class Stack {

	Node first;
	//String abc;
	public class Node {
		String data;
		Node next = null;
	}
		
	void push (String data){
		//String[] abc = new String[3];
		
		Queens queens = null;
		
		System.out.println(queens);
		if (first == null){
			first = new Node();
			first.data = data;
		}
		else{
		Node temp = new Node();
		temp.data = data;
		temp.next = first;
		first = temp;
		}
	}
	
	String pop (){
		Node temp=first;
		first = first.next;
		return temp.data;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Stack stack = new Stack();
		
		stack.push("4");
		stack.push("5");
		stack.push("7");
		
		System.out.println("Stack Pop "+stack.pop());
	}

	public Object peek() {
		return (first==null ? null : first.data);
	}

}
